/* 主题变量定义 */
:root {
  /* 水墨风格主题变量 */
  --ink-primary-color: #141414;
  --ink-secondary-color: #262626;
  --ink-bg-color: #f0f2f5;
  --ink-text-color: #262626;
  --ink-border-color: rgba(0, 0, 0, 0.06);
  --ink-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ink-gradient: linear-gradient(to right, #141414, #262626);
  --ink-card-bg: linear-gradient(to bottom, #ffffff, #f9f9f9);
  --ink-font-family: "KaiTi", "楷体", serif;
  --ink-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath fill-rule='evenodd' d='M11 0l5 20H6l5-20zm42 31a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM0 72h40v4H0v-4zm0-8h31v4H0v-4zm20-16h20v4H20v-4zM0 56h40v4H0v-4zm63-25a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM53 41a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-30 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-28-8a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zM56 5a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zm-3 46a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM21 0l5 20H16l5-20zm43 64v-4h-4v4h-4v4h4v4h4v-4h4v-4h-4zM36 13h4v4h-4v-4zm4 4h4v4h-4v-4zm-4 4h4v4h-4v-4zm8-8h4v4h-4v-4z'/%3E%3C/g%3E%3C/svg%3E");
  
  /* 卡通可爱风格主题变量 */
  --cartoon-primary-color: #ff6b6b;
  --cartoon-secondary-color: #feca57;
  --cartoon-bg-color: #f9f7f7;
  --cartoon-text-color: #48466d;
  --cartoon-border-color: rgba(255, 107, 107, 0.3);
  --cartoon-shadow: 0 4px 12px rgba(254, 202, 87, 0.3);
  --cartoon-gradient: linear-gradient(45deg, #ff6b6b, #feca57);
  --cartoon-card-bg: linear-gradient(to bottom, #ffffff, #ffeef1);
  --cartoon-font-family: "Comic Sans MS", "微软雅黑", sans-serif;
  --cartoon-pattern: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ff6b6b' fill-opacity='0.1'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  
  /* 动画时间 */
  --transition-slow: 0.5s;
  --transition-medium: 0.3s;
  --transition-fast: 0.15s;
  
  /* 圆角 */
  --border-radius-small: 4px;
  --border-radius-medium: 8px;
  --border-radius-large: 16px;
  --border-radius-extra-large: a 24px;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* 水墨风格 */
.theme-ink {
  --primary-color: var(--ink-primary-color);
  --secondary-color: var(--ink-secondary-color);
  --bg-color: var(--ink-bg-color);
  --text-color: var(--ink-text-color);
  --border-color: var(--ink-border-color);
  --shadow: var(--ink-shadow);
  --gradient: var(--ink-gradient);
  --card-bg: var(--ink-card-bg);
  --font-family: var(--ink-font-family);
  --pattern: var(--ink-pattern);
}

/* 卡通可爱风格 */
.theme-cartoon {
  --primary-color: var(--cartoon-primary-color);
  --secondary-color: var(--cartoon-secondary-color);
  --bg-color: var(--cartoon-bg-color);
  --text-color: var(--cartoon-text-color);
  --border-color: var(--cartoon-border-color);
  --shadow: var(--cartoon-shadow);
  --gradient: var(--cartoon-gradient);
  --card-bg: var(--cartoon-card-bg);
  --font-family: var(--cartoon-font-family);
  --pattern: var(--cartoon-pattern);
}

/* 通用过渡效果 */
.transition-all {
  transition: all var(--transition-medium) ease;
}

/* 卡片悬浮效果 */
.card-hover {
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.theme-ink .card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.theme-cartoon .card-hover:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
}

/* 按钮动画 */
.theme-ink .animated-button {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-medium);
}

.theme-ink .animated-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.theme-ink .animated-button:hover::after {
  animation: ripple 1s ease-out;
}

.theme-cartoon .animated-button {
  transition: all var(--transition-medium);
}

.theme-cartoon .animated-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(255, 107, 107, 0.3);
}

.theme-cartoon .animated-button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* 页面背景图案 */
.theme-ink .patterned-bg {
  background-image: var(--ink-pattern);
  background-color: var(--ink-bg-color);
}

.theme-cartoon .patterned-bg {
  background-image: var(--cartoon-pattern);
  background-color: var(--cartoon-bg-color);
}

/* 输入框美化 */
.theme-ink .styled-input {
  border: 1px solid var(--ink-border-color);
  border-radius: var(--border-radius-small);
  transition: all var(--transition-fast);
}

.theme-ink .styled-input:focus {
  border-color: var(--ink-primary-color);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.theme-cartoon .styled-input {
  border: 1px solid var(--cartoon-border-color);
  border-radius: var(--border-radius-medium);
  transition: all var(--transition-fast);
}

.theme-cartoon .styled-input:focus {
  border-color: var(--cartoon-primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

/* 消息动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message-appear {
  animation: fadeInUp 0.3s ease-out forwards;
}

.assistant-message-appear {
  animation: fadeInRight 0.3s ease-out forwards;
}

/* 思考中动画 */
@keyframes thinking {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.thinking-dots::after {
  content: "...";
  display: inline-block;
  animation: thinking 1.5s infinite ease-in-out;
}

/* 文件标签动画 */
@keyframes tagPop {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.file-tag-appear {
  animation: tagPop 0.3s ease-out forwards;
}

/* 按钮点击波纹效果增强 */
.theme-cartoon .ripple-button {
  position: relative;
  overflow: hidden;
}

.theme-cartoon .ripple-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.theme-cartoon .ripple-button:active::after {
  animation: cartoonRipple 0.8s ease-out;
}

@keyframes cartoonRipple {
  0% {
    transform: scale(0, 0);
    opacity: 0.8;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* 输入框焦点动画 */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.theme-cartoon .input-focus-animation:focus {
  animation: pulse 1.5s infinite;
}

/* 页面切换动画 */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-transition {
  animation: pageEnter 0.4s ease-out forwards;
} 